﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Control_HienThiSanPham : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string query = "";
            if (Request.QueryString["MaKieu"] != null)
            {
                query = "select * from SanPham where MaKieu='" + Request.QueryString["MaKieu"].ToString() + "'";

            }
            else if (Request.QueryString["MaNhaCC"] != null)
                {
                    query = "select * from SanPham where MaNhaCC='" + Request.QueryString["MaNhaCC"].ToString() + "'";

                }
            else if (Request.QueryString["MaChatLieu"] != null)
            {
                query = "select * from SanPham where MaChatLieu='" + Request.QueryString["MaChatLieu"].ToString() + "'";
            }
            else if (Request.QueryString["MaSP"] != null)
            {
                query = "select * from SanPham where MaSP='" + Request.QueryString["MaSP"].ToString() + "'";
            }

            else
            {
                query = "select * from SanPham";
            }

            XuLy xl = new XuLy();
            DataList1.DataSource = xl.Load(query);
            DataList1.DataBind();
        }
    }
}